package com.gw.websocket.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
public class LoginController {
    @RequestMapping("/")
    public String login(){
        return "login";
    }
    @RequestMapping("/dologin")
    public String dologin(String uname, String upwd, HttpSession session){
        String msg="";
        if (!(uname!=null&&uname.length()>0&upwd!=null&upwd.length()>0)){
             return "login";
        }
        session.setAttribute("uname",uname);
        return "main";
    }
}
